﻿package mortal.game.view.active11
{
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.mvc.core.*;

    public class Active11Controller extends Controller
    {

        public function Active11Controller()
        {
            return;
        }// end function

        override protected function initServer() : void
        {
            Dispatcher.addEventListener(EventName.LoginGameSuccess, this.checkShowIcon);
            NetDispatcher.addCmdListener(ServerCommand.NewDayUpdate, this.checkShowIcon);
            ClockManager.instance.addEventListener(TimeEvent.DateChange, this.checkShowIcon);
            NetDispatcher.addCmdListener(ServerCommand.RoleLevelUpdate, this.checkShowIcon);
            return;
        }// end function

        protected function checkShowIcon(param1 = null) : void
        {
            if (Active11Util.isInActive11())
            {
                Active11Icon.instance.show();
            }
            else if (Active11Icon.hasInstance())
            {
                Active11Icon.instance.hide();
            }
            return;
        }// end function

    }
}
